home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / relgen.doc < prev    next >
Text File  |  1995-04-22  |  3KB  |  112 lines

  1.  
  2. Instructions for: 
  3.  
  4.   RELGEN.ACT:== Relocation Generator 
  5. & REOCAT.ACT:== Run-time Relocator 
  6.  
  7.   These programs were intended to 
  8. create a self-relocating object 
  9. file from either an ACTION! 
  10. compiled program or an Assembled 
  11. program. The original object file 
  12. must be a single-stage boot with 
  13. only one origin except for the 
  14. trailing run or init address. The 
  15. following instructions detail the 
  16. steps to make the target object 
  17. file. This file may be appended to 
  18. other binary load files and may 
  19. have other binary files appended to 
  20. it. The program will load at the 
  21. next possible page boundary 
  22. (increment of 256) after MEMLO. 
  23. Because RELGEN compares two 
  24. versions of you object file, you 
  25. may want to init all variables to 
  26. zero to keep the relocation table 
  27. at a minimum. Stray data in the 
  28. uninitialized variables may be 
  29. interpreted as machine code that 
  30. needs relocating. 
  31.  
  32. 1) Compile (or Assemble) your code 
  33.   at a convenient area but not 
  34.   conflicting with DOS. In ACTION!, 
  35.   use the following commands to 
  36.   force the program's origin to a 
  37.   specified value ($3000 for example): 
  38.     SET 14=$3000 
  39.     SET $491=$3000 
  40.  
  41. 2) Re-Compile your code at $100 
  42.   higher than the first. For the 
  43.   above example, this would be at 
  44.   $3100. 
  45.  
  46. 3) From the ACTION! monitor, RUN the 
  47. program RELGEN.ACT. It will prompt 
  48. you for the filenames for the two 
  49. object code files that you compiled 
  50. above. Remember to give the Dn: 
  51. prefix to the filenames. The program 
  52. will compare the two object files 
  53. and note their differences as offsets 
  54. into the file. This information is 
  55. saved in ACTION! form in a file with 
  56. the original name and a ".GEN" 
  57. extention. This will be used in the 
  58. next step. Also, the program creates 
  59. an object file image of the original 
  60. but with an origin of zero. This is 
  61. done to make the relocation process 
  62. easier and this file, with a ".REL" 
  63. extention will be used in step 5. 
  64.  
  65.   Note: RELGEN.ACT requires four open 
  66. DOS files simultaneously. By default, 
  67. DOS usually has buffers for only 3. 
  68. You must use the command: 
  69.  
  70.   SET $709=4 
  71.  
  72. in the ACTION! monitor and type D for 
  73. DOS. Rewrite DOS to the disk and 
  74. reboot. Now, DOS will allow the four 
  75. files to be opened. 
  76.  
  77. 4) Now, Read the program RELOC.ACT 
  78. into the ACTION! Editor. This is a 
  79. "generic" run-time relocator. The 
  80. file generated with the RELGEN.ACT 
  81. program (with the ".GEN" extention) 
  82. must be merged into this program 
  83. with the editor Read function. 
  84. Position the cursor where instructed 
  85. and read in the file. Compile this 
  86. code but be sure that it is SET to 
  87. compile above the expected end of 
  88. YOUR program's target location. 
  89. Save this object code to disk and 
  90. go to DOS. 
  91.  
  92. 5) Using the DOS Copy command, 
  93. append the ".REL" file generated in 
  94. RELGEN.ACT, to the merged relocator 
  95. file saved in step 4. For example: 
  96.  
  97. Copy from,to: 
  98. TEST.REL,AUTORUN.SYS/A 
  99.  
  100. This assumes that you saved the file 
  101. in Step 4 as AUTORUN.SYS. 
  102.  
  103. 6) Finally, the appended file can be 
  104. loaded from DOS or named AUTORUN.SYS 
  105. as above for permanent applications. 
  106.  
  107. If you have question, send E-Mail to: 
  108.   John DeMar 71066,337 on Compuserve 
  109. or leave a message on the ACE-BASE 
  110. BBS at (315)451-7747. Good Luck! 
  111.